package net.zkbc.helloworld.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

import net.zkbc.helloworld.entity.User;

public interface UserMapper {

	@Select("SELECT id,login_name AS loginName,password,salt FROM app_user WHERE login_name=#{loginName}")
	public User findByLoginName(String loginName);

	@Insert("INSERT INTO app_user(login_name,password,salt)VALUES(#{loginName},#{password},#{salt})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insert(User user);

}
